include(RunCMake)

run_cmake(BeforeVersionRemoved)
run_cmake(PolicyBeforeVersionRemoved)
run_cmake(Future)
run_cmake(BeforeVersionDeprecated)
run_cmake(Range)
run_cmake(RangeBad)
run_cmake(Unknown)

run_cmake_with_options(PolicyVersionVar -DCMAKE_POLICY_VERSION_MINIMUM=3.10)
run_cmake_with_options(PolicyVersionVarCache -DCMAKE_POLICY_VERSION_MINIMUM=3.10 -C ${CMAKE_CURRENT_LIST_DIR}/PolicyVersionVar.cmake)
run_cmake_script(PolicyVersionVarScript -DCMAKE_POLICY_VERSION_MINIMUM=3.10)
run_cmake_with_options(PolicyVersionVarBad -DCMAKE_POLICY_VERSION_MINIMUM=...3.10)
run_cmake_with_options(PolicyVersionVarBadCache -DCMAKE_POLICY_VERSION_MINIMUM=...3.10 -C ${CMAKE_CURRENT_LIST_DIR}/PolicyVersionVarBad.cmake)
run_cmake_script(PolicyVersionVarBadScript -DCMAKE_POLICY_VERSION_MINIMUM=...3.10)

set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.10)
run_cmake(PolicyVersionEnvVar)
run_cmake_with_options(PolicyVersionEnvVarCache -C ${CMAKE_CURRENT_LIST_DIR}/PolicyVersionEnvVar.cmake)
run_cmake_script(PolicyVersionEnvVarScript)
set(ENV{CMAKE_POLICY_VERSION_MINIMUM} ...3.10)
run_cmake(PolicyVersionEnvVarBad)
run_cmake_with_options(PolicyVersionEnvVarBadCache -C ${CMAKE_CURRENT_LIST_DIR}/PolicyVersionEnvVarBad.cmake)
run_cmake_script(PolicyVersionEnvVarBadScript)
unset(ENV{CMAKE_POLICY_VERSION_MINIMUM})
